@import "mixins";
@import "themes/default";

// Base styles

.button {
  display: inline-block;
  font-weight: $btn-font-weight;
  line-height: $btn-line-height;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  border: $input-btn-border-width solid transparent;
  transition: all .2s ease-in-out;
  @include button-size($btn-padding-y, $btn-padding-x, $font-size-base, $btn-border-radius);

  & > i {
    display: inline;
  }

  &,
  &:active {
    &:focus {
      @include tab-focus();
    }
  }

  @include hover-focus {
    text-decoration: none;
  }
  &:focus {
    text-decoration: none;
  }

  &:hover {
    @include box-shadow($btn-hover-box-shadow);
  }

  &:active {
    background-image: none;
    outline: 0;
    @include box-shadow($btn-active-box-shadow);
  }

  &:disabled {
    cursor: $cursor-disabled;
    opacity: .65;
    box-shadow: none;
  }
}

.primary {
  @include button-variant($btn-primary-color, $btn-primary-bg, $btn-primary-border);
}

// default
.secondary {
  @include button-variant($btn-secondary-color, $btn-secondary-bg, $btn-secondary-border);
}

.success {
  @include button-variant($btn-success-color, $btn-success-bg, $btn-success-border);
}

.error, .danger {
  @include button-variant($btn-danger-color, $btn-danger-bg, $btn-danger-border);
}

.warning {
  @include button-variant($btn-warning-color, $btn-warning-bg, $btn-warning-border);
}

.info {
  @include button-variant($btn-info-color, $btn-info-bg, $btn-info-border);
}

// Make a button look and behave like a link
.link {
  font-weight: normal;
  color: $link-color;
  border-radius: 0;

  &,
  &:active,
  &:disabled {
    background-color: transparent;
    @include box-shadow(none);
  }
  &,
  &:focus,
  &:active {
    border-color: transparent;
  }
  @include hover {
    box-shadow: none;
    border-color: transparent;
  }
  @include hover-focus {
    color: $link-hover-color;
    text-decoration: $link-hover-decoration;
    background-color: transparent;
  }
  &:disabled {
    @include hover-focus {
      color: $btn-link-disabled-color;
      text-decoration: none;
    }
  }
}

//
// Button Sizes
//

.large {
  // line-height: ensure even-numbered height of button next to large input
  @include button-size($btn-padding-y-lg, $btn-padding-x-lg, $font-size-lg, $btn-border-radius-lg);
}

.small {
  // line-height: ensure proper height of button next to small input
  @include button-size($btn-padding-y-sm, $btn-padding-x-sm, $font-size-sm, $btn-border-radius-sm);
}


